﻿using DelonixRegia__Staff_Use_.Classes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace DelonixRegia__Staff_Use_
{
    public partial class DeleteStaff : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            Label8.Text = Request.QueryString["name"];
            if (Label8.Text == "")
            {
                Response.Redirect("Login.aspx");
            }
            if (Label8.Text == "Admin")
            {
                Label10.Visible = true;
                LinkButton5.Visible = true;
                Label9.Visible = true;
                LinkButton4.Visible = true;
            }
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            if (Staff.DeleteStaffbyid(TextBox3.Text) == 1)
            {
                Label1.Text = "Successfully Deleted!";

            }
            else
            {
                Label1.Text = "Deleteion is unsuccessful!";
            }
        }
        protected void LinkButton3_Click(object sender, EventArgs e)
        {
            Response.Redirect("StaffUpdate.aspx?name=" + Label8.Text);
        }

        protected void LinkButton2_Click(object sender, EventArgs e)
        {
            Response.Redirect("StaffWorkTime.aspx?name=" + Label8.Text);
        }

        protected void LinkButton1_Click(object sender, EventArgs e)
        {
            Response.Redirect("Particulars.aspx?name=" + Label8.Text);
        }

        protected void LinkButton4_Click(object sender, EventArgs e)
        {
            Response.Redirect("CreateStaffAccount.aspx?name=" + Label8.Text);
        }
        protected void LinkButton6_Click(object sender, EventArgs e)
        {
            Response.Redirect("CancelBooking.aspx?name=" + Label8.Text);
        }

        protected void LinkButton5_Click(object sender, EventArgs e)
        {
            Response.Redirect("DeleteStaff.aspx?name=" + Label8.Text);
        }

        
    }
}